(desktop-read): Set `desktop-dirname' to nil before calling
authorJuanma Barranquero <lekktu@gmail.com>
Sat, 1 Mar 2008 13:56:16 +0000 (13:56 +0000)
committerJuanma Barranquero <lekktu@gmail.com>
Sat, 1 Mar 2008 13:56:16 +0000 (13:56 +0000)
`desktop-not-loaded-hook' to allow modifying it.
Don't show warning message if `desktop-dirname' was modified.

lisp/desktop.el

index fbf9ed5c04493203399203f24a67bda7ba398d1e..a042828e19c44d0b6f207f5ce2eb2f296251e143 100644 (file)
@@ -967,11 +967,11 @@ It returns t if a desktop file was loaded, nil otherwise."
                   (or (null desktop-load-locked-desktop)
                       (not (y-or-n-p (format "Warning: desktop file appears to be in use by PID %s.\n\
 Using it may cause conflicts.  Use it anyway? " owner)))))
-             (progn
-               (let ((default-directory desktop-dirname))
-                 (run-hooks 'desktop-not-loaded-hook))
+             (let ((default-directory desktop-dirname))
                (setq desktop-dirname nil)
-               (message "Desktop file in use; not loaded."))
+               (run-hooks 'desktop-not-loaded-hook)
+               (unless desktop-dirname
+                 (message "Desktop file in use; not loaded.")))
            (desktop-lazy-abort)
            ;; Evaluate desktop buffer and remember when it was modified.
            (load (desktop-full-file-name) t t t)